home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CU Amiga Super CD-ROM 14
/
CU Amiga Magazine's Super CD-ROM 14 (1997)(EMAP Images)(GB)(Track 1 of 3)[!][issue 1997-09].iso
/
System
/
CDsupport
/
IDer
/
Routines
/
GetFileName.s
< prev
next >
Wrap
Text File
|
1997-02-18
|
1KB
|
84 lines
Tst.L _FileName ;have we already got a filename
Beq.S .UseASL
Tst.L _WBMessage ;were the arguments from Workbench?
Bne.S .UseIcons
;=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Move.L _FileName(PC),A0
Move.L A0,_CurrentName
Moveq #0,D0
.RDLoop Addq #1,D0
Cmp.L #0,(A0)+
Bne.S .RDLoop
Subq #1,D0
Beq LaunchFinished
Move.W D0,_LoopCount
Clr.L _FileName
Move.W #ARGS_READARG,_ArgMode
Bra .FileNameFound
;=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
.UseIcons Move.L _WBMessage(PC),A0
Move.L sm_ArgList(A0),A1
Move.L sm_NumArgs(A0),D0
Addq #8,A1
Move.L A1,_CurrentName
Subq #1,D0
Beq LaunchFinished
Move.W D0,_LoopCount
Clr.L FileName
Move.W #ARGS_ICONS,_ArgMode
Bra .FileNameFound
;=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
.UseASL Tst.B _UseAppIcon
Bne .UseAppIcon
Move.W #ASLOPENERR,_ErrorCode
Lea ASLLibrary(PC),A1
Moveq #38,D0
CALL OpenLibrary,EXEC
Move.L D0,_ASLBase
Beq LaunchDone
Move.W #ASLREQERR,_ErrorCode
Moveq #ASL_FileRequest,D0
Sub.L A0,A0
CALL AllocAslRequest,ASL
Move.L D0,_Requestor
Beq LaunchDone
Clr.W _ErrorCode
Move.L _Requestor(PC),A0
Lea _ASLTags(PC),A1
CALL AslRequest
Cmp.L #FALSE,D0
Beq.S .FileNameFound
Move.L _Requestor(PC),A0
Move.L fr_ArgList(A0),_CurrentName
Move.L fr_NumArgs(A0),D0
Move.W D0,_LoopCount
Beq LaunchDone
Clr.L _FileName
Move.W #ARGS_ASLREQ,_ArgMode
Bra.S .FileNameFound
;=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
.UseAppIcon Clr.W _ErrorCode
Clr.L _FileName
Clr.W _ArgMode
;=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
.FileNameFound